package com.charley.icloud.admin.webapps.sysuser.service;

import com.charley.icloud.admin.pojo.entity.SysUserRole;
import com.charley.icloud.admin.webapps.sysuser.pojo.entity.SysUserDO;
import com.charley.icloud.datasource.page.PageRequest;
import com.charley.icloud.datasource.service.CurdService;

import java.io.File;
import java.util.List;
import java.util.Set;

/**
 * 用户管理
 */
public interface SysUserService extends CurdService<SysUserDO> {

	SysUserDO findByUserName(String username);

	SysUserDO findByAccount(String account);

	/**
	 * 根据账号查找用户的菜单权限标识集合
	 */
	Set<String> findPermissions(String account);

	Set<String> findPermissions(SysUserDO sysUser);

	/**
	 * 查找用户的角色集合
	 */
	List<SysUserRole> findUserRoles(Long userId);

	/**
	 * 生成用户信息Excel文件
	 */
	File createUserExcelFile(PageRequest pageRequest);

	Boolean existUserByAccount(String account);
}
